package com.qfedu.service.impl;

import com.qfedu.dao.SysCarMapper;
import com.qfedu.pojo.SysCar;
import com.qfedu.service.SysCarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysCarServiceImpl implements SysCarService {
    @Autowired
    private SysCarMapper sysCarDao;

    // 按租金排序
    @Override
    public List<SysCar> findByPrice(Integer cid) {
        List<SysCar> list = sysCarDao.findByPrice(cid);
        return list;
    }

    // 按热度排序
    @Override
    public List<SysCar> findByNum(Integer cid) {
        List<SysCar> list = sysCarDao.findByNum(cid);
        return list;
    }

    @Override
    public SysCar findBiId(Integer id) {
        SysCar sysCar = sysCarDao.selectByPrimaryKey(id);
        return sysCar;
    }
}